POV-Ray : Newsgroups : povray.general : POV Parsing : Re: POV Parsing Server Time
9 Aug 2024 15:24:44 EDT (-0400)
  Re: POV Parsing  
From: Warp
Date: 30 Aug 2000 19:33:49
Message: <39ad99dd@news.povray.org>
David Fontaine <dav### [at] faricynet> wrote:
: Okay, but how can byte-code be platform dependant then?

  Well, it depends how you make your byte code.

  The most efficient way of storing numbers (integers and floats) is to
write their byte values in memory directly to the file as raw binary data.
In this way they will take the least space and they can be read very fast
(you don't have to parse it, you just read that binary data directly into
the memory location that represents your variable).

  This is, however, very system-dependant. Some systems use big-endian
numbers while others use low-endian numbers. If you try to read a big-endian
number directly into a variable, as described above, but the system uses
low-endian numbers, the value assigned to the variable will be little less
than rubbish.

  You could of course change the endianess of the number while reading if
you know that you have to, but that destroys the point why we are making
this in the first place: Speed.

  Endianess, however, is not the only problem. Some systems can use a
different floating point number format than other systems. Even when using
the same format (usually the IEEE standard format), the size (in bytes) of
the numbers may differ.
  When we are dealing with integers, there might be some systems that do
not use a complement-of-2 format for them, as most systems do. Again, if
we try to read raw binary data of the wrong format, we get just rubbish.

  Another way of storing the numbers is to use a povray-specific and
platform-independent format and then for each specific system parse this
number and convert it to the native format.
  The ascii representation of a number (the one we use in povray code) is,
in fact, this kind of platform-independent coding.
  The ascii representation as one drawback: It's long and inefficient.
  A more compact and efficient representation could be designed, but still
we have to problem of slow parsing and conversion between formats.

: What about control aids? They would process much faster in byte-code. Thorsten
: says it already does something like this though...

  I don't know how isosurface functions are implemented in megapov, but I
wouldn't be surprised if they were converted to byte-code (which uses
stack arithmetic) which is interpreted while rendering. And we all know
how fast isosurfaces are (they are incredibly fast).
  Someone who knows could tell us how it is done.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.